When a loop is divided into a plurality of threads (i.e. multithreading), it is necessary for the final value of variables to be the same whether processing in parallel or processing sequentially. This is referred to as “guaranteeing final values”.
The technology in Patent Literatures 1 and 2 is known technology for guaranteeing final values.
In Patent Literature 2, when a loop is parallelized, a region is provided for each parallel process. A code indicating whether a repetition is the last repetition is attached to the variables defined in each parallel process, and the variables are stored in the corresponding region.
After all of the parallel processes for the loop have completed, the variables corresponding to the process responsible for the last repetition are identified by referring to the code attached to the variables stored in the above regions. By retrieving the identified variables, it is asserted that the value of variables can be referred to properly.